#include<iostream>
using namespace std;
#include<thread>
#include<unistd.h>

class mythread{
    public:
        int num;
};

void thread_run(){
    cout<<"我是新进程"<<endl;
    sleep(2);
}
int main(){
    thread t1(thread_run);//创建线程,参数是要执行的执行流
    while(true){
        cout<<"我是主线程 "<<endl;
        sleep(1);
    }

    t1.join();//等待了新进程
    return 0;
}